<template>
  <div class="container">
    <xy-table
      :api="api"
      :columns="columns"
    >
      <template #view>
        <span></span>
      </template>

      <template #check="{ row }">
        <el-col
          :span="8"
          class="center"
        >
          <el-tooltip
            :content="$language.local('下载')"
            :enterable="false"
            class="item"
            effect="dark"
            placement="top"
          >
            <el-button
              @click="onDownload(row)"
              circle
              icon="el-icon-download"
              size="mini"
              type="success"
            ></el-button>
          </el-tooltip>
        </el-col>
      </template>
    </xy-table>
  </div>
</template>

<script>
import API from "../../plugins/api";
export default {
  data() {
    return {
      api: new API("/api/DataTemplate/GetList"),
      columns: {
        TemplateCode: "1",
        TemplateName: "灵工模板",
        Ver: "1         ",
        // URL: "/upload/202106/15/20210615163630190.xls",
      },
      formData: {
        TemplateCode: "1",
        TemplateName: "灵工模板",
        Ver: "1         ",
        URL: "/upload/202106/15/20210615163630190.xls",
      },
    };
  },
  methods: {
    onDownload(e) {
      console.log(e);
      this.$common.download(e.URL);
    },
  },
};
</script>

<style></style>
